home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1993 / MacHack 1993.toast / MacHack™ 1987-1992 / MacHack™ '90 / Other Stuff / Networking ƒ / ATP Sample App / code fragments / receiving < prev    next >
Encoding:
Text File  |  1990-06-12  |  794 b   |  36 lines  |  [TEXT/MPS ]

  1.     pb->ioRefNum = ATP_REFNUM;
  2.     pb->ioCompletion = 0;
  3.     pb->csCode = getRequest;
  4.  
  5.     pb->atpSkt = atpSocket;
  6.     pb->atpFlgs = 0;
  7.  
  8.     pb->getReqUnion.reqLength = size;
  9.     pb->getReqUnion.reqPointer = pData;
  10.  
  11.     result = PBControl(&iopb, TRUE);
  12.     while (pb->ioResult > 0)
  13.         {
  14.         if (Button())
  15.             {
  16.             atpParam iopbKill;
  17.             
  18.             /* kill pending getRequest */
  19.             iopbKill.ioRefNum = ATP_REFNUM;
  20.             iopbKill.csCode = killGetReq;
  21.             iopbKill.killReqUnion.killQEl = (struct atpRBlk *)&iopb;
  22.  
  23.             result = PBControl(&iopbKill, FALSE);
  24.             printf("kill getRequest result %d\n", result);
  25.             *requestSize = -1;
  26.             return 0;
  27.             }
  28.         }
  29.     
  30.     *requestSize = pb->getReqUnion.reqLength;
  31.     *tid = pb->getReqUnion.tid;
  32.     
  33.     addr->na_network = pb->addrBlk.network;
  34.     addr->na_node = pb->addrBlk.node;
  35.     addr->na_socket = pb->addrBlk.socket;
  36.